import request from '@/utils/request'

/**
* @description:获取权限列表
* @param {type}
* @return:
*/
export function getPermissionList(params) {
  return request({
    url: '/sys/permission',
    params
  })
}
/**
* @description:新增权限
* @param {type}
* @return:
*/
export function addPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

/**
* @description:更新权限
* @param {type}:id
* @return:
*/
export function updatePermission(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

/**
* @description:删除权限
* @param {type}:id
* @return:
*/
export function delPermission(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

/**
* @description:获取权限详情
* @param {type}: id
* @return:
*/
export function getPermissionDetail(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}
